﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MachiningHelper.ToolFile
{
    #region Skipper100型号，板件的UserData参数
    public class BiesseEditorUserData
    {
       public string PMOD { get; set; }
       public string NPAN { get; set; }
       public string PLAV { get; set; }
       public string PSCA { get; set; }
       public string SPR { get; set; }
       public string PCAY { get; set; }
       public string PTIN { get; set; }
       public string PSIM { get; set; }
       public static BiesseEditorUserData LoadUserdata(string pmod,string npan,string plav,string psca,string spr,string pcay,string ptin,string psim)
       {
           BiesseEditorUserData data = new BiesseEditorUserData();
           data.PMOD = pmod;
           data.NPAN = npan;
           data.PLAV = plav;
           data.PSCA = psca;
           data.SPR = spr;
           data.PCAY = pcay;
           data.PTIN = ptin;
           data.PSIM = psim;
           return data;
       }
       public static string SetUserData(Content Custstr,BiesseEditorUserData data)
       {

           string HeadStr = Custstr.Body.Substring(0, Custstr.Body.Length - 1);
           string Endstr = Custstr.Body.Substring(Custstr.Body.Length - 1, 1);
           Custstr.Body = string.Format("{0}{1},{2},{3},{4},{5},{6},{7},{8}{9}", HeadStr, data.PMOD, data.NPAN, data.PLAV, data.PSCA, data.SPR, data.PCAY, data.PTIN, data.PSIM, Endstr);
           return Custstr.Body;
       }
    }
    #endregion
}
